//
//  HTTPClient.h
//  storeapp
//
//  Created by huangyi on 13-12-27.
//  Copyright (c) 2013年 ios. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface HTTPClient : NSObject

@property(nonatomic,readonly)NSMutableURLRequest *requestObject;
@property(nonatomic,readonly)NSData *responseData;
@property(nonatomic,readonly)NSDictionary *responseHeaderFields;
@property(nonatomic,readonly)NSString *responseContentType;
@property(nonatomic,readonly)NSInteger statusCode;

@property(nonatomic,strong)NSString *message;
@property(nonatomic,strong)NSError *error;

@property(nonatomic,readonly)NSString *fullURLString;
@property(nonatomic,readonly)BOOL multipart;
@property(nonatomic,readonly)BOOL gzip;

-(instancetype)initWithURLString:(NSString*)fullstring;
-(void)execute;
-(void)executeNoOutput;

-(void)setHTTPMethod:(NSString*)method;
-(void)setContentType:(NSString*)type;
-(void)setHeaderField:(NSString*)header withValue:(id)value;
-(void)setTimeoutInterval:(NSTimeInterval)seconds;

-(void)setPostObject:(NSDictionary*)form;
-(void)setPostData:(NSData*)data;

-(void)setMultipartForm:(BOOL)mp;
-(void)setGZipData:(BOOL)gz;

-(void)parse:(NSHTTPURLResponse*)response;

@end
